if(files.cwd().endsWith("脚本")){
    let _require = require;
    require = function(path){
      if(path.startsWith("./")){
        path = path.replace("./","");
      }
      path = files.cwd() + "/gdt_hb/" + path;
      return _require(path);
    }
  }
  
  
  auto.waitFor()
  var utils = require("./utils.js");
  var storage = storages.create("xiangxiangyuedu");
  
function main(){
    var open = utils.launchAppEnhance("莱森社区");
    sleep(10000)
    if(open){
        waitForActivity("com.uzmap.pkg.EntranceActivity")
        sleep(500)
        var 签到 = text("签到").findOne(60000);
        if(签到){
            console.log('找到签到')
            utils.realClick(签到);
            if(textContains("签到成功").findOne(20000)){
                utils.updateAppProgress(70);
            }
        }else{
            console.log('未找到签到')   
        }
    }
}

try {
    main();
    utils.updateAppProgress(100);
  } catch (error) {
    toastLog(error);
  }
storage.put("script_running_status", "end");
